<input type='hidden' id='uid' value='{$uid}' />
<input type='hidden' id='uname' value='{$uname}' />
<input type='hidden' id='title' value='{$title}' />
<input type='hidden' id='image' value='{$image}' />
<input type='hidden' id='real_pay' value='{$real_pay}' />
<input type='hidden' id='red_give' value='{$red_give}' />
<input type='hidden' id='all_pay' value='{$all_pay}' />
<input type='hidden' id='give_jifen' value='{$give_jifen}' />
<script type="text/javascript">
    //调用微信JS api 支付
    function jsApiCall()
    {
        WeixinJSBridge.invoke(
            'getBrandWCPayRequest',{$json},
            function(res){
//                WeixinJSBridge.log(res.err_msg);
                if(res.err_msg == 'get_brand_wcpay_request:ok'){
                    var uid = document.getElementById('uid').value;
                    var uname = document.getElementById('uname').value;
                    var title = document.getElementById('title').value;
                    var image = document.getElementById('image').value;
                    var real_pay = document.getElementById('real_pay').value;
                    var red_give = document.getElementById('red_give').value;
                    var all_pay = document.getElementById('all_pay').value;
                    var give_jifen = document.getElementById('give_jifen').value;
                    setTimeout(function() {
                        location.href = 'https://csdl.jintianjifen.cn/admin/test/test?uid=' + uid+'&uname=' + uname+'&title=' + title+'&image=' + image+'&real_pay=' + real_pay+'&red_give=' + red_give+'&all_pay=' + all_pay+'&give_jifen=' + give_jifen;
                    },1000)
//                    alert('支付成功');
//                    去我的预约里的预约成功的页面（第一次带弹窗出信息）;
                }else{
                    alert('支付失败');
//                    $('.all_div').css('display','none');
                    location.reload();
                }
            }
        );
    }
    function callpay()
    {
        if (typeof WeixinJSBridge == "undefined"){
            if( document.addEventListener ){
                document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
            }else if (document.attachEvent){
                document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
            }
        }else{
            jsApiCall();
        }
    }
    callpay();
</script>